﻿@using WikeSoft.Core.Extension
@using WikeSoft.Data.Enum
@using WikeSoft.Enterprise.Enum
@model WikeSoft.Enterprise.Models.Sys.UserAddModel
@{
    ViewBag.Title = "添加用户";
    Layout = "~/Views/Shared/_Form.cshtml";
    string departmentId = Request["departmentId"];
    string v = System.Configuration.ConfigurationManager.AppSettings["version"];
}
@section scripts{

    <script src="~/Scripts/page/wike.user.dialog.js?v=@v"></script>
    @*<script type="text/javascript">
        $(function() {
            $("#UserName").blur(function() {
                $.ajax({
                    url: '/User/IsExists', //后台处理程序
                    //数据发送方式
                    contentType: "application/json, charset=utf-8",
                    datatype: 'JSON',
                    data: { UserName: $(this).val() },
                    success: function(msg) {
                        //window.location.href = "/home/login";
                    }
                });
            });
        });

    </script>*@
     
}



<form class="form-horizontal" action="@Url.Action("FrameAdd")" method="post" id="userForm">
    <input type="hidden" id="DepartmentId" name="DepartmentId" value="@departmentId"/>

    <div class="row">
        <div class="col-xs-12">
            <fieldset>
                <legend>基本信息</legend>
            </fieldset>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-6">
            <div class="form-group">
                @Html.LabelFor(x => x.UserName, new { @class = "col-sm-2 control-label" })
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.UserName, new { @class = "form-control", placeholder = "" })
                    @Html.ValidationMessageFor(x => x.UserName)

                </div>
            </div>
        </div>
        <div class="col-xs-6">
            <div class="form-group">
                @Html.LabelFor(x => x.PassWord, new { @class = "col-sm-2 control-label" })
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.PassWord, new { @class = "form-control", placeholder = "" })
                    @Html.ValidationMessageFor(x => x.PassWord)

                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-6">
            <div class="form-group">
                @Html.LabelFor(x => x.TrueName, new {@class = "col-sm-2 control-label"})
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.TrueName, new {@class = "form-control", placeholder = ""})
                    @Html.ValidationMessageFor(x => x.TrueName)

                </div>
            </div>
        </div>
        <div class="col-xs-6">
            <div class="form-group">
                @Html.LabelFor(x => x.Email, new {@class = "col-sm-2 control-label"})
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.Email, new {@class = "form-control", placeholder = ""})
                    @Html.ValidationMessageFor(x => x.Email)

                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-6">
            <div class="form-group">
                @Html.LabelFor(x => x.Mobile, new {@class = "col-sm-2 control-label"})
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.Mobile, new {@class = "form-control", placeholder = ""})
                    @Html.ValidationMessageFor(x => x.Mobile)

                </div>
            </div>
        </div>
        <div class="col-xs-6">
            <div class="form-group">
                @Html.LabelFor(x => x.UserStatus, new {@class = "col-sm-2 control-label"})
                <div class="col-sm-10">
                    @Html.DropDownListFor(x => x.UserStatus, typeof (UserStatus), new {@class = "form-control"})

                    @Html.ValidationMessageFor(x => x.UserStatus)

                </div>
            </div>
        </div>
    </div>


    <div class="row">
        
        <div class="col-xs-6">
            <div class="form-group">
                @Html.LabelFor(x => x.UserCode, new { @class = "col-sm-2 control-label" })
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.UserCode, new { @class = "form-control", placeholder = "" })
                    @Html.ValidationMessageFor(x => x.UserCode)

                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            @Html.Action("RolePartial")
        </div>
    </div>
    <div>
        <div style="text-align: center">
            <button class="btn btn-default" type="submit" action="submit">保存</button>
            <button class="btn btn-default" type="button" action="back" data-url="/User/FrameIndex?departmentId=@departmentId">返回 </button>
        </div>

    </div>
</form>
 